<html>
<head>
<meta charset="UTF-8">
<title>SSH部署插件修改</title>
	<link id="easyuiTheme" href="../../static/easyui/themes/bootstrap/easyui.css" rel="stylesheet" type="text/css"/>
	<link href="../../static/easyui/themes/icon.css" rel="stylesheet" type="text/css"/>
	<link href="../../static/css/esaas-easyui-edit.css" rel="stylesheet" type="text/css"/>
	<script src="../../static/easyui/jquery.min.js" type="text/javascript"></script>
	<script src="../../static/easyui/jquery.cookie.js" type="text/javascript"></script>
	<script src="../../static/easyui/ui-theme.js" type="text/javascript"></script>
	<script src="../../static/easyui/jquery.easyui.min.js" type="text/javascript" charset="utf-8"></script>
	<script src="../../static/easyui/locale/easyui-lang-zh_CN.js" type="text/javascript"></script>
	<script src="../../static/plugin/assets/jslib.util.js" type="text/javascript"></script>
	<script src="../../static/plugin/assets/jslib.jquery.ajax.js" type="text/javascript"></script>
	<script src="../../static/plugin/assets/jslib.easyui.util.js" type="text/javascript"></script>
	<script src="../../ffres/dict/all.js" type="text/javascript"></script>
	<a href="" target="_blank" id="commonLink" name="commonLink"></a>
</head>
<body class="easyui-layout" scroll="no">
	<form id="ff" method="post">
		<div class="esaas-info-title">部署节点信息</div>
		<table class="esaas-info-edit-table">
			<tr>
				<td width="15%" align="right">服务器IP：</td>
				<td width="35%"><input class="easyui-textbox" type="text"
					name="serverIp" data-options="required:true"
					style="width: 100%; height: 25px;"></input></td>
				<td width="15%" align="right">应用部署名称：</td>
				<td width="35%"><input class="easyui-textbox" type="text" 
					name="appName" data-options="required:false"
					style="width: 100%; height: 25px;"></input></td>
			</tr>
			<tr>
				<td width="15%" align="right">服务器用户名：</td>
				<td width="35%"><input class="easyui-textbox" type="text"
					name="serverUserName" data-options="required:true"
					style="width: 100%; height: 25px;"></input></td>
				<td width="15%" align="right">服务器用户密码：</td>
				<td width="35%"><input class="easyui-textbox" type="password"
					name="serverPwd" data-options="required:false"
					style="width: 100%; height: 25px;"></input></td>
			</tr>
			<tr>
				<td width="15%" align="right">Tomcat版本：</td>
				<td width="35%"><input class="easyui-textbox" type="text" 
					name="tomcatVersion" data-options="required:false"
					style="width: 100%; height: 25px;"></input></td>
				<td width="15%" align="right">Tomcat端口：</td>
				<td width="35%"><input class="easyui-textbox" type="text" 
					name="tomcatPort" data-options="required:false"
					style="width: 100%; height: 25px;"></input></td>
			</tr>
			<tr>
				<td width="15%" align="right">应用编译结果目录：</td>
				<td width="35%"><input class="easyui-textbox" type="text" 
					name="appArtifactLocation" data-options="required:false"
					style="width: 100%; height: 25px;"></input></td>
				<td width="15%" align="right" hidden>应用Id：</td>d
				<td width="35%" hidden><input class="easyui-textbox" type="text"
									   name="appId" data-options="required:false"
									   style="width: 100%; height: 25px;"></input></td>
			</tr>
		</table>
	</form>
	<div class="esaas-info-buttons">
		<a href="javascript:void(0)" class="easyui-linkbutton " iconCls="icon-ok" onclick="submitForm()" style="width:90px">&nbsp;保&nbsp;存&nbsp;</a>
		<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-cancel" onclick="closeForm()" style="width:90px">&nbsp;关&nbsp;闭&nbsp;</a>
	</div>
	<script>
		var bpmNodeId = $.getUrlParam('bpmNodeId');
		$(function() {
		    addTitle("修改");
			$.restfulGet('../../api/bpm/node/info/'+bpmNodeId,null,function(data){
				var nodeData = jQuery.parseJSON(data.rows.bpmNodeParam);
					$('#ff').form('load', {
						serverIp : nodeData.serverIp,
						appName : nodeData.appName,
						serverUserName : nodeData.serverUserName,
						serverPwd : nodeData.serverPwd,
						tomcatVersion : nodeData.tomcatVersion,
						tomcatPort : nodeData.tomcatPort,
						appArtifactLocation : nodeData.appArtifactLocation,
						appId:nodeData.appId
					});
			});
		});
		function submitForm() {
			if (!$('#ff').form('validate'))
				return;
			var jsonData = $("#ff").serializeJson();
			let nodeUpdateData={
			    bpmNodeId:bpmNodeId,
			    bpmNodeParam:JSON.stringify(jsonData),
			}
			$.restfulPut('../../api/bpm/node/info', nodeUpdateData, function(data) {
				window.parent.getSSHNode();
				window.parent.JLEUtil.closewin();
			});
		};
		
		function closeForm(){
			window.parent.JLEUtil.closewin();
		}
	</script>
</body>
</html>